summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ipv6_sockglue.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2005-09-08 10:19:03 +0900
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2005-09-08 10:19:03 +0900
commit41a1f8ea4fbfcdc4232f023732584aae2220de31 (patch)
tree9939686b354ced0b22d81efcbc12f5ed90372b09 /net/ipv6/ipv6_sockglue.c
parent333fad5364d6b457c8d837f7d05802d2aaf8a961 (diff)
downloadblackbird-op-linux-41a1f8ea4fbfcdc4232f023732584aae2220de31.tar.gz
blackbird-op-linux-41a1f8ea4fbfcdc4232f023732584aae2220de31.zip
[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.c22
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,
retv = 0;
break;
+ case IPV6_TCLASS:
+ if (val < 0 || val > 0xff)
+ goto e_inval;
+ np->tclass = val;
+ retv = 0;
+ break;
+
+ case IPV6_RECVTCLASS:
+ np->rxopt.bits.rxtclass = valbool;
+ retv = 0;
+ break;
+
case IPV6_FLOWINFO:
np->rxopt.bits.rxflow = valbool;
retv = 0;
@@ -364,7 +376,7 @@ sticky_done:
msg.msg_controllen = optlen;
msg.msg_control = (void*)(opt+1);
- retv = datagram_send_ctl(&msg, &fl, opt, &junk);
+ retv = datagram_send_ctl(&msg, &fl, opt, &junk, &junk);
if (retv)
goto done;
update:
@@ -787,6 +799,14 @@ int ipv6_getsockopt(struct sock *sk, int level, int optname,
val = np->rxopt.bits.odstopts;
break;
+ case IPV6_TCLASS:
+ val = np->tclass;
+ break;
+
+ case IPV6_RECVTCLASS:
+ val = np->rxopt.bits.rxtclass;
+ break;
+
case IPV6_FLOWINFO:
val = np->rxopt.bits.rxflow;
break;
OpenPOWER on IntegriCloud