Module Name:    src
Committed By:   kefren
Date:           Tue Jul 16 19:40:01 UTC 2013

Modified Files:
        src/usr.sbin/ldpd: tlv_stack.c

Log Message:
send the actual prefix on the wire instead of struct headers
statify


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/ldpd/tlv_stack.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/ldpd/tlv_stack.c
diff -u src/usr.sbin/ldpd/tlv_stack.c:1.8 src/usr.sbin/ldpd/tlv_stack.c:1.9
--- src/usr.sbin/ldpd/tlv_stack.c:1.8	Thu Jul 11 10:46:19 2013
+++ src/usr.sbin/ldpd/tlv_stack.c	Tue Jul 16 19:40:01 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: tlv_stack.c,v 1.8 2013/07/11 10:46:19 kefren Exp $ */
+/* $NetBSD: tlv_stack.c,v 1.9 2013/07/16 19:40:01 kefren Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -47,9 +47,9 @@
 #include "mpls_interface.h"
 #include "tlv_stack.h"
 
-uint8_t ldp_ceil8(int);
+static uint8_t ldp_ceil8(int);
 
-uint8_t 
+static uint8_t 
 ldp_ceil8(int x)
 {
 	if (x % 8 == 0)
@@ -285,7 +285,8 @@ send_label_tlv(const struct ldp_peer * p
 	p->type = FEC_PREFIX;
 	p->af = htons(LDP_AF_INET);
 	p->prelen = prefixlen;
-	memcpy(&p->prefix, addr, ldp_ceil8(prefixlen));
+	memcpy(&p->prefix, & ((const struct sockaddr_in*)addr)->sin_addr,
+	    ldp_ceil8(prefixlen));
 
 	/* LABEL TLV */
 	l = (struct label_tlv *) ((unsigned char *) p +

Reply via email to