Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122731
b: refs/heads/master
c: b24a251
h: refs/heads/master
i:
  122729: 3ae7013
  122727: 0b89414
v: v3
  • Loading branch information
Yang Hongyang authored and David S. Miller committed Dec 16, 2008
1 parent d2cf1b1 commit ad5bf19
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc02ff95fe4ebd3e5ee7455c0aa6f76ebe39ebca
refs/heads/master: b24a2516d10751d7ed5afb58420df25370c9dffb
1 change: 1 addition & 0 deletions trunk/include/linux/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ struct ipv6_pinfo {
struct in6_addr saddr;
struct in6_addr rcv_saddr;
struct in6_addr daddr;
struct in6_pktinfo sticky_pktinfo;
struct in6_addr *daddr_cache;
#ifdef CONFIG_IPV6_SUBTREES
struct in6_addr *saddr_cache;
Expand Down
22 changes: 22 additions & 0 deletions trunk/net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,28 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
break;
}

case IPV6_PKTINFO:
{
struct in6_pktinfo pkt;

if (optlen == 0)
goto e_inval;
else if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
goto e_inval;

if (copy_from_user(&pkt, optval, optlen)) {
retv = -EFAULT;
break;
}
if (sk->sk_bound_dev_if && pkt.ipi6_ifindex != sk->sk_bound_dev_if)
goto e_inval;

np->sticky_pktinfo.ipi6_ifindex = pkt.ipi6_ifindex;
ipv6_addr_copy(&np->sticky_pktinfo.ipi6_addr, &pkt.ipi6_addr);
retv = 0;
break;
}

case IPV6_2292PKTOPTIONS:
{
struct ipv6_txoptions *opt = NULL;
Expand Down

0 comments on commit ad5bf19

Please sign in to comment.