Fix xfrm_user.c and tcp_diag.c netlink dump:  We have to set NLM_F_MULTI.

Signed-off-by: Harald Welte <laforge@gnumonks.org>

--- linux-2.6.9-rc3-bk9-test/net/ipv4/tcp_diag.c	2004-10-10 14:01:47.000000000 +0200
+++ linux-2.6.9-rc3-bk9-test-xfrm_netlink/net/ipv4/tcp_diag.c	2004-10-15 21:02:19.000000000 +0200
@@ -97,7 +97,7 @@
 }
 
 static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,
-			int ext, u32 pid, u32 seq)
+			int ext, u32 pid, u32 seq, u16 nlmsg_flags)
 {
 	struct inet_opt *inet = inet_sk(sk);
 	struct tcp_opt *tp = tcp_sk(sk);
@@ -224,6 +224,7 @@
 	}
 
 	nlh->nlmsg_len = skb->tail - b;
+	nlh->nlmsg_flags = nlmsg_flags;
 	return skb->len;
 
 nlmsg_failure:
@@ -280,7 +281,7 @@
 
 	if (tcpdiag_fill(rep, sk, req->tcpdiag_ext,
 			 NETLINK_CB(in_skb).pid,
-			 nlh->nlmsg_seq) <= 0)
+			 nlh->nlmsg_seq, 0) <= 0)
 		BUG();
 
 	err = netlink_unicast(tcpnl, rep, NETLINK_CB(in_skb).pid, MSG_DONTWAIT);
@@ -506,7 +507,8 @@
 					goto next_listen;
 				if (tcpdiag_fill(skb, sk, r->tcpdiag_ext,
 						 NETLINK_CB(cb->skb).pid,
-						 cb->nlh->nlmsg_seq) <= 0) {
+						 cb->nlh->nlmsg_seq,
+						 NLM_F_MULTI) <= 0) {
 					tcp_listen_unlock();
 					goto done;
 				}
@@ -550,7 +552,8 @@
 				goto next_normal;
 			if (tcpdiag_fill(skb, sk, r->tcpdiag_ext,
 					 NETLINK_CB(cb->skb).pid,
-					 cb->nlh->nlmsg_seq) <= 0) {
+					 cb->nlh->nlmsg_seq,
+					 NLM_F_MULTI) <= 0) {
 				read_unlock_bh(&head->lock);
 				goto done;
 			}
@@ -575,7 +578,8 @@
 					goto next_dying;
 				if (tcpdiag_fill(skb, sk, r->tcpdiag_ext,
 						 NETLINK_CB(cb->skb).pid,
-						 cb->nlh->nlmsg_seq) <= 0) {
+						 cb->nlh->nlmsg_seq,
+						 NLM_F_MULTI) <= 0) {
 					read_unlock_bh(&head->lock);
 					goto done;
 				}
diff -Nru linux-2.6.9-rc3-bk9-test/net/xfrm/xfrm_user.c linux-2.6.9-rc3-bk9-test-xfrm_netlink/net/xfrm/xfrm_user.c
--- linux-2.6.9-rc3-bk9-test/net/xfrm/xfrm_user.c	2004-10-10 14:01:03.000000000 +0200
+++ linux-2.6.9-rc3-bk9-test-xfrm_netlink/net/xfrm/xfrm_user.c	2004-10-15 20:55:58.000000000 +0200
@@ -351,7 +351,10 @@
 	nlh = NLMSG_PUT(skb, NETLINK_CB(in_skb).pid,
 			sp->nlmsg_seq,
 			XFRM_MSG_NEWSA, sizeof(*p));
-	nlh->nlmsg_flags = 0;
+	if (count != 0)
+		nlh->nlmsg_flags = NLM_F_MULTI;
+	else
+		nlh->nlmsg_flags = 0;
 
 	p = NLMSG_DATA(nlh);
 	copy_to_user_state(x, p);
