patch-2.4.10 linux/net/appletalk/ddp.c

Next file: linux/net/ax25/af_ax25.c
Previous file: linux/mm/vmscan.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/net/appletalk/ddp.c linux/net/appletalk/ddp.c
@@ -752,7 +752,7 @@
 
 /* ioctl calls. Shouldn't even need touching */
 /* Device configuration ioctl calls */
-int atif_ioctl(int cmd, void *arg)
+static int atif_ioctl(int cmd, void *arg)
 {
 	static char aarp_mcast[6] = {0x09, 0x00, 0x00, 0xFF, 0xFF, 0xFF};
 	struct ifreq atreq;
@@ -1390,7 +1390,7 @@
 
 	/* Trim buffer in case of stray trailing data */
 	origlen = skb->len;
-	skb_trim(skb, min(unsigned int, skb->len, ddphv.deh_len));
+	skb_trim(skb, min_t(unsigned int, skb->len, ddphv.deh_len));
 
 	/*
 	 * Size check to see if ddp->deh_len was crap
@@ -1455,7 +1455,7 @@
 		}
 
                 /* Fix up skb->len field */
-                skb_trim(skb, min(unsigned int, origlen, rt->dev->hard_header_len +
+                skb_trim(skb, min_t(unsigned int, origlen, rt->dev->hard_header_len +
 			ddp_dl->header_length + ddphv.deh_len));
 
 		/* Mend the byte order */
@@ -1855,7 +1855,15 @@
 		case SIOCDIFADDR:
 		case SIOCSARP:	/* proxy AARP */
 		case SIOCDARP:	/* proxy AARP */
-			return atif_ioctl(cmd, (void *)arg);
+		{
+			int ret;
+
+			rtnl_lock();
+			ret = atif_ioctl(cmd, (void *)arg);
+			rtnl_unlock();
+
+			return ret;
+		}
 		/* Physical layer ioctl calls */
 		case SIOCSIFLINK:
 		case SIOCGIFHWADDR:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)