aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-03-20 18:51:09 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-20 18:51:09 -0400
commit0fa74a4be48e0f810d3dc6ddbc9d6ac7e86cbee8 (patch)
treeccfee93ede4e36d6d355e00e485d3d1c0fec0bdd /net/ipv6
parent6626af692692b52c8f9e20ad8201a3255e5ab25b (diff)
parent4de930efc23b92ddf88ce91c405ee645fe6e27ea (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/emulex/benet/be_main.c net/core/sysctl_net_core.c net/ipv4/inet_diag.c The be_main.c conflict resolution was really tricky. The conflict hunks generated by GIT were very unhelpful, to say the least. It split functions in half and moved them around, when the real actual conflict only existed solely inside of one function, that being be_map_pci_bars(). So instead, to resolve this, I checked out be_main.c from the top of net-next, then I applied the be_main.c changes from 'net' since the last time I merged. And this worked beautifully. The inet_diag.c and sysctl_net_core.c conflicts were simple overlapping changes, and were easily to resolve. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/fib6_rules.c1
-rw-r--r--net/ipv6/ip6_output.c1
-rw-r--r--net/ipv6/ip6_tunnel.c33
-rw-r--r--net/ipv6/udp_offload.c8
-rw-r--r--net/ipv6/xfrm6_output.c2
-rw-r--r--net/ipv6/xfrm6_policy.c1
6 files changed, 24 insertions, 22 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index b4d5e1d97c1b..27ca79682efb 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -104,6 +104,7 @@ static int fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
104 goto again; 104 goto again;
105 flp6->saddr = saddr; 105 flp6->saddr = saddr;
106 } 106 }
107 err = rt->dst.error;
107 goto out; 108 goto out;
108 } 109 }
109again: 110again:
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 0a04a37305d5..7e80b61b51ff 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -318,6 +318,7 @@ static int ip6_forward_proxy_check(struct sk_buff *skb)
318 318
319static inline int ip6_forward_finish(struct sk_buff *skb) 319static inline int ip6_forward_finish(struct sk_buff *skb)
320{ 320{
321 skb_sender_cpu_clear(skb);
321 return dst_output(skb); 322 return dst_output(skb);
322} 323}
323 324
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 88300d42fc95..41f84f76ad9d 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -308,7 +308,7 @@ out:
308 * Create tunnel matching given parameters. 308 * Create tunnel matching given parameters.
309 * 309 *
310 * Return: 310 * Return:
311 * created tunnel or NULL 311 * created tunnel or error pointer
312 **/ 312 **/
313 313
314static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p) 314static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
@@ -316,7 +316,7 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
316 struct net_device *dev; 316 struct net_device *dev;
317 struct ip6_tnl *t; 317 struct ip6_tnl *t;
318 char name[IFNAMSIZ]; 318 char name[IFNAMSIZ];
319 int err; 319 int err = -ENOMEM;
320 320
321 if (p->name[0]) 321 if (p->name[0])
322 strlcpy(name, p->name, IFNAMSIZ); 322 strlcpy(name, p->name, IFNAMSIZ);
@@ -342,7 +342,7 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
342failed_free: 342failed_free:
343 ip6_dev_free(dev); 343 ip6_dev_free(dev);
344failed: 344failed:
345 return NULL; 345 return ERR_PTR(err);
346} 346}
347 347
348/** 348/**
@@ -356,7 +356,7 @@ failed:
356 * tunnel device is created and registered for use. 356 * tunnel device is created and registered for use.
357 * 357 *
358 * Return: 358 * Return:
359 * matching tunnel or NULL 359 * matching tunnel or error pointer
360 **/ 360 **/
361 361
362static struct ip6_tnl *ip6_tnl_locate(struct net *net, 362static struct ip6_tnl *ip6_tnl_locate(struct net *net,
@@ -374,13 +374,13 @@ static struct ip6_tnl *ip6_tnl_locate(struct net *net,
374 if (ipv6_addr_equal(local, &t->parms.laddr) && 374 if (ipv6_addr_equal(local, &t->parms.laddr) &&
375 ipv6_addr_equal(remote, &t->parms.raddr)) { 375 ipv6_addr_equal(remote, &t->parms.raddr)) {
376 if (create) 376 if (create)
377 return NULL; 377 return ERR_PTR(-EEXIST);
378 378
379 return t; 379 return t;
380 } 380 }
381 } 381 }
382 if (!create) 382 if (!create)
383 return NULL; 383 return ERR_PTR(-ENODEV);
384 return ip6_tnl_create(net, p); 384 return ip6_tnl_create(net, p);
385} 385}
386 386
@@ -1414,7 +1414,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1414 } 1414 }
1415 ip6_tnl_parm_from_user(&p1, &p); 1415 ip6_tnl_parm_from_user(&p1, &p);
1416 t = ip6_tnl_locate(net, &p1, 0); 1416 t = ip6_tnl_locate(net, &p1, 0);
1417 if (t == NULL) 1417 if (IS_ERR(t))
1418 t = netdev_priv(dev); 1418 t = netdev_priv(dev);
1419 } else { 1419 } else {
1420 memset(&p, 0, sizeof(p)); 1420 memset(&p, 0, sizeof(p));
@@ -1439,7 +1439,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1439 ip6_tnl_parm_from_user(&p1, &p); 1439 ip6_tnl_parm_from_user(&p1, &p);
1440 t = ip6_tnl_locate(net, &p1, cmd == SIOCADDTUNNEL); 1440 t = ip6_tnl_locate(net, &p1, cmd == SIOCADDTUNNEL);
1441 if (cmd == SIOCCHGTUNNEL) { 1441 if (cmd == SIOCCHGTUNNEL) {
1442 if (t != NULL) { 1442 if (!IS_ERR(t)) {
1443 if (t->dev != dev) { 1443 if (t->dev != dev) {
1444 err = -EEXIST; 1444 err = -EEXIST;
1445 break; 1445 break;
@@ -1451,14 +1451,15 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1451 else 1451 else
1452 err = ip6_tnl_update(t, &p1); 1452 err = ip6_tnl_update(t, &p1);
1453 } 1453 }
1454 if (t) { 1454 if (!IS_ERR(t)) {
1455 err = 0; 1455 err = 0;
1456 ip6_tnl_parm_to_user(&p, &t->parms); 1456 ip6_tnl_parm_to_user(&p, &t->parms);
1457 if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p))) 1457 if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p)))
1458 err = -EFAULT; 1458 err = -EFAULT;
1459 1459
1460 } else 1460 } else {
1461 err = (cmd == SIOCADDTUNNEL ? -ENOBUFS : -ENOENT); 1461 err = PTR_ERR(t);
1462 }
1462 break; 1463 break;
1463 case SIOCDELTUNNEL: 1464 case SIOCDELTUNNEL:
1464 err = -EPERM; 1465 err = -EPERM;
@@ -1472,7 +1473,7 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1472 err = -ENOENT; 1473 err = -ENOENT;
1473 ip6_tnl_parm_from_user(&p1, &p); 1474 ip6_tnl_parm_from_user(&p1, &p);
1474 t = ip6_tnl_locate(net, &p1, 0); 1475 t = ip6_tnl_locate(net, &p1, 0);
1475 if (t == NULL) 1476 if (IS_ERR(t))
1476 break; 1477 break;
1477 err = -EPERM; 1478 err = -EPERM;
1478 if (t->dev == ip6n->fb_tnl_dev) 1479 if (t->dev == ip6n->fb_tnl_dev)
@@ -1666,12 +1667,13 @@ static int ip6_tnl_newlink(struct net *src_net, struct net_device *dev,
1666 struct nlattr *tb[], struct nlattr *data[]) 1667 struct nlattr *tb[], struct nlattr *data[])
1667{ 1668{
1668 struct net *net = dev_net(dev); 1669 struct net *net = dev_net(dev);
1669 struct ip6_tnl *nt; 1670 struct ip6_tnl *nt, *t;
1670 1671
1671 nt = netdev_priv(dev); 1672 nt = netdev_priv(dev);
1672 ip6_tnl_netlink_parms(data, &nt->parms); 1673 ip6_tnl_netlink_parms(data, &nt->parms);
1673 1674
1674 if (ip6_tnl_locate(net, &nt->parms, 0)) 1675 t = ip6_tnl_locate(net, &nt->parms, 0);
1676 if (!IS_ERR(t))
1675 return -EEXIST; 1677 return -EEXIST;
1676 1678
1677 return ip6_tnl_create2(dev); 1679 return ip6_tnl_create2(dev);
@@ -1691,8 +1693,7 @@ static int ip6_tnl_changelink(struct net_device *dev, struct nlattr *tb[],
1691 ip6_tnl_netlink_parms(data, &p); 1693 ip6_tnl_netlink_parms(data, &p);
1692 1694
1693 t = ip6_tnl_locate(net, &p, 0); 1695 t = ip6_tnl_locate(net, &p, 0);
1694 1696 if (!IS_ERR(t)) {
1695 if (t) {
1696 if (t->dev != dev) 1697 if (t->dev != dev)
1697 return -EEXIST; 1698 return -EEXIST;
1698 } else 1699 } else
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c
index ab889bb16b3c..be2c0ba82c85 100644
--- a/net/ipv6/udp_offload.c
+++ b/net/ipv6/udp_offload.c
@@ -112,11 +112,9 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
112 fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen); 112 fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen);
113 fptr->nexthdr = nexthdr; 113 fptr->nexthdr = nexthdr;
114 fptr->reserved = 0; 114 fptr->reserved = 0;
115 if (skb_shinfo(skb)->ip6_frag_id) 115 if (!skb_shinfo(skb)->ip6_frag_id)
116 fptr->identification = skb_shinfo(skb)->ip6_frag_id; 116 ipv6_proxy_select_ident(skb);
117 else 117 fptr->identification = skb_shinfo(skb)->ip6_frag_id;
118 ipv6_select_ident(fptr,
119 (struct rt6_info *)skb_dst(skb));
120 118
121 /* Fragment the skb. ipv6 header and the remaining fields of the 119 /* Fragment the skb. ipv6 header and the remaining fields of the
122 * fragment header are updated in ipv6_gso_segment() 120 * fragment header are updated in ipv6_gso_segment()
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
index ca3f29b98ae5..010f8bd2d577 100644
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -114,6 +114,7 @@ int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb)
114 return err; 114 return err;
115 115
116 skb->ignore_df = 1; 116 skb->ignore_df = 1;
117 skb->protocol = htons(ETH_P_IPV6);
117 118
118 return x->outer_mode->output2(x, skb); 119 return x->outer_mode->output2(x, skb);
119} 120}
@@ -122,7 +123,6 @@ EXPORT_SYMBOL(xfrm6_prepare_output);
122int xfrm6_output_finish(struct sk_buff *skb) 123int xfrm6_output_finish(struct sk_buff *skb)
123{ 124{
124 memset(IP6CB(skb), 0, sizeof(*IP6CB(skb))); 125 memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
125 skb->protocol = htons(ETH_P_IPV6);
126 126
127#ifdef CONFIG_NETFILTER 127#ifdef CONFIG_NETFILTER
128 IP6CB(skb)->flags |= IP6SKB_XFRM_TRANSFORMED; 128 IP6CB(skb)->flags |= IP6SKB_XFRM_TRANSFORMED;
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 8ddf2b545151..11dbcc1790d2 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -200,6 +200,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse)
200 200
201#if IS_ENABLED(CONFIG_IPV6_MIP6) 201#if IS_ENABLED(CONFIG_IPV6_MIP6)
202 case IPPROTO_MH: 202 case IPPROTO_MH:
203 offset += ipv6_optlen(exthdr);
203 if (!onlyproto && pskb_may_pull(skb, nh + offset + 3 - skb->data)) { 204 if (!onlyproto && pskb_may_pull(skb, nh + offset + 3 - skb->data)) {
204 struct ip6_mh *mh; 205 struct ip6_mh *mh;
205 206