diff options
author | John Dykstra <john.dykstra1@gmail.com> | 2009-10-20 00:53:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-20 02:22:52 -0400 |
commit | 0eae750e6019a93643063924209c1daf9cb9b4a7 (patch) | |
tree | a9c85a1561be628ed6bd45e70ebd833fdd1828a9 | |
parent | ce5eb7a29251a66e613a300532b642ddc23b48d8 (diff) |
IP: Cleanups
Use symbols instead of magic constants while checking PMTU discovery
setsockopt.
Remove redundant test in ip_rt_frag_needed() (done by caller).
Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/ip_sockglue.c | 2 | ||||
-rw-r--r-- | net/ipv4/route.c | 3 | ||||
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 2 |
3 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index c602d985fe14..2445fedec0b8 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -575,7 +575,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
575 | inet->hdrincl = val ? 1 : 0; | 575 | inet->hdrincl = val ? 1 : 0; |
576 | break; | 576 | break; |
577 | case IP_MTU_DISCOVER: | 577 | case IP_MTU_DISCOVER: |
578 | if (val < 0 || val > 3) | 578 | if (val < IP_PMTUDISC_DONT || val > IP_PMTUDISC_PROBE) |
579 | goto e_inval; | 579 | goto e_inval; |
580 | inet->pmtudisc = val; | 580 | inet->pmtudisc = val; |
581 | break; | 581 | break; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index bb4199252026..68fb22702051 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1628,9 +1628,6 @@ unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, | |||
1628 | __be32 daddr = iph->daddr; | 1628 | __be32 daddr = iph->daddr; |
1629 | unsigned short est_mtu = 0; | 1629 | unsigned short est_mtu = 0; |
1630 | 1630 | ||
1631 | if (ipv4_config.no_pmtu_disc) | ||
1632 | return 0; | ||
1633 | |||
1634 | for (k = 0; k < 2; k++) { | 1631 | for (k = 0; k < 2; k++) { |
1635 | for (i = 0; i < 2; i++) { | 1632 | for (i = 0; i < 2; i++) { |
1636 | unsigned hash = rt_hash(daddr, skeys[i], ikeys[k], | 1633 | unsigned hash = rt_hash(daddr, skeys[i], ikeys[k], |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 39e10ac88019..68566de4bcc5 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -662,7 +662,7 @@ done: | |||
662 | case IPV6_MTU_DISCOVER: | 662 | case IPV6_MTU_DISCOVER: |
663 | if (optlen < sizeof(int)) | 663 | if (optlen < sizeof(int)) |
664 | goto e_inval; | 664 | goto e_inval; |
665 | if (val<0 || val>3) | 665 | if (val < IP_PMTUDISC_DONT || val > IP_PMTUDISC_PROBE) |
666 | goto e_inval; | 666 | goto e_inval; |
667 | np->pmtudisc = val; | 667 | np->pmtudisc = val; |
668 | retv = 0; | 668 | retv = 0; |