[IPv6]: Can not set the IPV6_PKTINFO option

The Linux manpage of ipv6(7) mentions the IPV6_PKTINFO option (and it is 
defined in header
files), but there is no setsockopt support for it. Aliasing to IPV6_RECVPKTINFO 
fixes this,
and checking datagram_recv_ctl() in net/ipv6/datagram.c confirms that this 
works as 
expected from the API.

Signed-off-by: Gerrit Renker <[EMAIL PROTECTED]>
---
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -315,6 +315,7 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, 
int optname,
                retv = 0;
                break;
 
+       case IPV6_PKTINFO:
        case IPV6_RECVPKTINFO:
                np->rxopt.bits.rxinfo = valbool;
                retv = 0;
@@ -928,6 +929,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, 
int optname,
                val = np->ipv6only;
                break;
 
+       case IPV6_PKTINFO:
        case IPV6_RECVPKTINFO:
                val = np->rxopt.bits.rxinfo;
                break;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to