patch-2.1.8 linux/net/ipv4/udp.c

Next file: linux/net/ipv6/Makefile
Previous file: linux/net/ipv4/timer.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.7/linux/net/ipv4/udp.c linux/net/ipv4/udp.c
@@ -150,8 +150,8 @@
  * to find the appropriate port.
  */
 
-void udp_err(int type, int code, unsigned char *header, __u32 daddr,
-	__u32 saddr, struct inet_protocol *protocol)
+void udp_err(int type, int code, unsigned char *header, __u32 info,
+	     __u32 daddr, __u32 saddr, struct inet_protocol *protocol)
 {
 	struct udphdr *uh;
 	struct sock *sk;
@@ -437,8 +437,8 @@
  *	Temporary
  */
  
-static int udp_sendmsg(struct sock *sk, struct msghdr *msg, int len, int noblock, 
-	int flags)
+int udp_sendmsg(struct sock *sk, struct msghdr *msg, int len, int noblock, 
+		int flags)
 {
 	if(msg->msg_iovlen==1)
 		return udp_sendto(sk,msg->msg_iov[0].iov_base,len, noblock, flags, msg->msg_name, msg->msg_namelen);
@@ -523,7 +523,7 @@
 
 
 /*
- * 	This should be easy, if there is something there we\
+ * 	This should be easy, if there is something there we
  * 	return it, otherwise we block.
  */
 
@@ -591,8 +591,9 @@
   	return(copied);
 }
 
-int udp_connect(struct sock *sk, struct sockaddr_in *usin, int addr_len)
+int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
 {
+	struct sockaddr_in *usin = (struct sockaddr_in *) uaddr;
 	struct rtable *rt;
 	if (addr_len < sizeof(*usin)) 
 	  	return(-EINVAL);
@@ -632,7 +633,7 @@
 	destroy_sock(sk);
 }
 
-static inline void udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
+static inline int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
 {
 	/*
 	 *	Charge it to the socket, dropping if the queue is full.
@@ -647,9 +648,10 @@
 		ip_statistics.IpInDelivers--;
 		skb->sk = NULL;
 		kfree_skb(skb, FREE_WRITE);
-		return;
+		return 0;
 	}
 	udp_statistics.UdpInDatagrams++;
+	return 0;
 }
 
 
@@ -699,15 +701,6 @@
 	int addr_type;
 
 	/*
-	 * If we're doing a "redo" (the socket was busy last time
-	 * around), we can just queue the packet now..
-	 */
-	if (redo) {
-		udp_queue_rcv_skb(skb->sk, skb);
-		return 0;
-	}
-
-	/*
 	 * First time through the loop.. Do all the setup stuff
 	 * (including finding out the socket we go to etc)
 	 */
@@ -843,26 +836,26 @@
 
 struct proto udp_prot = {
 	udp_close,
-	ip_build_header,
 	udp_connect,
 	NULL,
-	ip_queue_xmit,
 	NULL,
 	NULL,
 	NULL,
-	udp_rcv,
 	datagram_select,
 	udp_ioctl,
 	NULL,
 	NULL,
+	NULL,
 	ip_setsockopt,
 	ip_getsockopt,
 	udp_sendmsg,
 	udp_recvmsg,
-	NULL,		/* No special bind function */
+	NULL,			/* No special bind function */
+	udp_queue_rcv_skb,     
 	128,
 	0,
 	"UDP",
 	0, 0,
-	{NULL,}
+	NULL
 };
+

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov