patch-2.0.5 linux/net/ipv4/ip_sockglue.c
Next file: linux/scripts/Menuconfig
Previous file: linux/net/ipv4/ip_output.c
Back to the patch index
Back to the overall index
- Lines: 63
- Date:
Tue Jul 9 08:39:55 1996
- Orig file:
v2.0.4/linux/net/ipv4/ip_sockglue.c
- Orig date:
Tue May 7 16:22:41 1996
diff -u --recursive --new-file v2.0.4/linux/net/ipv4/ip_sockglue.c linux/net/ipv4/ip_sockglue.c
@@ -178,17 +178,18 @@
kfree_s(old_opt, sizeof(struct optlen) + old_opt->optlen);
return 0;
}
- case IP_TOS: /* This sets both TOS and Precedence */
- if (val<0 || val>63) /* Reject setting of unused bits */
+ case IP_TOS: /* This sets both TOS and Precedence */
+ if (val & ~0xfe) /* Reject setting of unused bits */
return -EINVAL;
- if ((val&7) > 4 && !suser()) /* Only root can set Prec>4 */
+ if ((val>>5) > 4 && !suser()) /* Only root can set Prec>4 */
return -EPERM;
sk->ip_tos=val;
- switch (val & 0x38) {
+ switch (val & 0x1E) {
case IPTOS_LOWDELAY:
sk->priority=SOPRI_INTERACTIVE;
break;
case IPTOS_THROUGHPUT:
+ case IPTOS_MINCOST:
sk->priority=SOPRI_BACKGROUND;
break;
default:
@@ -270,7 +271,6 @@
* FIXME: Add/Del membership should have a semaphore protecting them from re-entry
*/
struct ip_mreq mreq;
- __u32 route_src;
struct rtable *rt;
struct device *dev=NULL;
@@ -295,9 +295,8 @@
*/
if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL)
{
- dev=rt->rt_dev;
- route_src = rt->rt_src;
- atomic_dec(&rt->rt_use);
+ dev=rt->u.dst.dev;
+ atomic_dec(&rt->u.dst.use);
ip_rt_put(rt);
}
}
@@ -328,7 +327,6 @@
{
struct ip_mreq mreq;
struct rtable *rt;
- __u32 route_src;
struct device *dev=NULL;
/*
@@ -349,9 +347,8 @@
{
if((rt=ip_rt_route(mreq.imr_multiaddr.s_addr,0))!=NULL)
{
- dev=rt->rt_dev;
- atomic_dec(&rt->rt_use);
- route_src = rt->rt_src;
+ dev=rt->u.dst.dev;
+ atomic_dec(&rt->u.dst.use);
ip_rt_put(rt);
}
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov