diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-09-07 21:19:03 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2005-09-07 21:19:03 -0400 |
commit | 41a1f8ea4fbfcdc4232f023732584aae2220de31 (patch) | |
tree | 9939686b354ced0b22d81efcbc12f5ed90372b09 /net/ipv6/ipv6_sockglue.c | |
parent | 333fad5364d6b457c8d837f7d05802d2aaf8a961 (diff) |
[IPV6]: Support IPV6_{RECV,}TCLASS socket options / ancillary data.
Based on patch from David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index dc1d9914bf7d..8567873d0dd8 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -264,6 +264,18 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
264 | retv = 0; | 264 | retv = 0; |
265 | break; | 265 | break; |
266 | 266 | ||
267 | case IPV6_TCLASS: | ||
268 | if (val < 0 || val > 0xff) | ||
269 | goto e_inval; | ||
270 | np->tclass = val; | ||
271 | retv = 0; | ||
272 | break; | ||
273 | |||
274 | case IPV6_RECVTCLASS: | ||
275 | np->rxopt.bits.rxtclass = valbool; | ||
276 | retv = 0; | ||
277 | break; | ||
278 | |||
267 | case IPV6_FLOWINFO: | 279 | case IPV6_FLOWINFO: |
268 | np->rxopt.bits.rxflow = valbool; | 280 | np->rxopt.bits.rxflow = valbool; |
269 | retv = 0; | 281 | retv = 0; |
@@ -364,7 +376,7 @@ sticky_done: | |||
364 | msg.msg_controllen = optlen; | 376 | msg.msg_controllen = optlen; |
365 | msg.msg_control = (void*)(opt+1); | 377 | msg.msg_control = (void*)(opt+1); |
366 | 378 | ||
367 | retv = datagram_send_ctl(&msg, &fl, opt, &junk); | 379 | retv = datagram_send_ctl(&msg, &fl, opt, &junk, &junk); |
368 | if (retv) | 380 | if (retv) |
369 | goto done; | 381 | goto done; |
370 | update: | 382 | update: |
@@ -787,6 +799,14 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
787 | val = np->rxopt.bits.odstopts; | 799 | val = np->rxopt.bits.odstopts; |
788 | break; | 800 | break; |
789 | 801 | ||
802 | case IPV6_TCLASS: | ||
803 | val = np->tclass; | ||
804 | break; | ||
805 | |||
806 | case IPV6_RECVTCLASS: | ||
807 | val = np->rxopt.bits.rxtclass; | ||
808 | break; | ||
809 | |||
790 | case IPV6_FLOWINFO: | 810 | case IPV6_FLOWINFO: |
791 | val = np->rxopt.bits.rxflow; | 811 | val = np->rxopt.bits.rxflow; |
792 | break; | 812 | break; |