Skip to content

Commit

Permalink
net/libndp: + Neighbor discovery protocol library.
Browse files Browse the repository at this point in the history
Sponsored by:	Serenity Cybersecurity, LLC
  • Loading branch information
arrowd committed Mar 6, 2023
1 parent 014a5f6 commit ceb716d
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@
SUBDIR += libmdf
SUBDIR += libmediawiki
SUBDIR += libnatpmp
SUBDIR += libndp
SUBDIR += libnet
SUBDIR += libnfs
SUBDIR += libngtcp2
Expand Down
21 changes: 21 additions & 0 deletions net/libndp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PORTNAME= libndp
PORTVERSION= 1.8
CATEGORIES= net

MAINTAINER= arrowd@FreeBSD.org
COMMENT= Neighbor discovery library
WWW= https://github.com/jpirko/libndp

LICENSE= LGPL21
LICENSE_FILE= ${WRKSRC}/COPYING

USES= autoreconf libtool

GNU_CONFIGURE= yes
USE_LDCONFIG= yes

USE_GITHUB= yes
GH_ACCOUNT= jpirko
GH_TAGNAME= v${PORTVERSION}

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions net/libndp/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TIMESTAMP = 1678114865
SHA256 (jpirko-libndp-1.8-v1.8_GH0.tar.gz) = c3ea76e253def89869651686a827da75b56896fe94fabd87d8c14b1d4588fd05
SIZE (jpirko-libndp-1.8-v1.8_GH0.tar.gz) = 29145
29 changes: 29 additions & 0 deletions net/libndp/files/patch-libndp_libndp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- libndp/libndp.c.orig 2021-05-20 09:39:25 UTC
+++ libndp/libndp.c
@@ -35,6 +35,17 @@
#include <net/if.h>
#include <sys/ioctl.h>

+#ifdef __FreeBSD__
+#define s6_addr8 __u6_addr.__u6_addr8
+#define s6_addr16 __u6_addr.__u6_addr16
+#define s6_addr32 __u6_addr.__u6_addr32
+#define SIOCGIFHWADDR SIOCGIFMAC
+#define ND_RA_FLAG_HOME_AGENT ND_RA_FLAG_HA
+#define ND_OPT_PI_FLAG_RADDR 0x20
+#define ifr_hwaddr ifr_addr
+#define ETH_ALEN 6
+#endif
+
#include "ndp_private.h"
#include "list.h"

@@ -209,7 +220,7 @@ resend:
memcpy(&sin6.sin6_addr, addr, sizeof(sin6.sin6_addr));
sin6.sin6_scope_id = ifindex;
resend:
- ret = sendto(sockfd, buf, buflen, flags, &sin6, sizeof(sin6));
+ ret = sendto(sockfd, buf, buflen, flags, (struct sockaddr*)&sin6, sizeof(sin6));
if (ret == -1) {
switch(errno) {
case EINTR:
3 changes: 3 additions & 0 deletions net/libndp/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This package contains a library which provides a wrapper for IPv6 Neighbor
Discovery Protocol. It also provides a tool named ndptool for sending and
receiving NDP messages.
8 changes: 8 additions & 0 deletions net/libndp/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bin/ndptool
include/ndp.h
lib/libndp.a
lib/libndp.so
lib/libndp.so.0
lib/libndp.so.0.2.0
libdata/pkgconfig/libndp.pc
man/man8/ndptool.8.gz

0 comments on commit ceb716d

Please sign in to comment.