-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This package drops all incoming router advertisements except for the default router with the best metric according to B.A.T.M.A.N. advanced. Note that advertisements originating from the node itself (for example via gluon-radvd) are not affected.
- Loading branch information
Showing
6 changed files
with
583 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=gluon-radv-filterd | ||
PKG_VERSION:=1 | ||
PKG_RELEASE:=1 | ||
|
||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) | ||
|
||
include $(INCLUDE_DIR)/package.mk | ||
|
||
define Package/gluon-radv-filterd | ||
SECTION:=gluon | ||
CATEGORY:=Gluon | ||
TITLE:=Filter IPv6 router advertisements | ||
DEPENDS:=+gluon-ebtables | ||
endef | ||
|
||
define Package/gluon-radv-filterd/description | ||
Gluon community wifi mesh firmware framework: filter IPv6 router advertisements | ||
endef | ||
|
||
define Build/Prepare | ||
mkdir -p $(PKG_BUILD_DIR) | ||
$(CP) ./src/* $(PKG_BUILD_DIR)/ | ||
endef | ||
|
||
define Build/Configure | ||
endef | ||
|
||
define Build/Compile | ||
CFLAGS="$(TARGET_CFLAGS)" CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) | ||
endef | ||
|
||
define Package/gluon-radv-filterd/install | ||
$(CP) ./files/* $(1)/ | ||
|
||
$(INSTALL_DIR) $(1)/usr/sbin/ | ||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/gluon-radv-filterd $(1)/usr/sbin/ | ||
endef | ||
|
||
$(eval $(call BuildPackage,gluon-radv-filterd)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
gluon-radv-filterd | ||
================== | ||
This package drops all incoming router advertisements except for the | ||
default router with the best metric according to B.A.T.M.A.N. advanced. | ||
|
||
Note that advertisements originating from the node itself (for example | ||
via gluon-radvd) are not affected. |
17 changes: 17 additions & 0 deletions
17
package/gluon-radv-filterd/files/etc/init.d/gluon-radv-filterd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
START=50 | ||
|
||
SERVICE_WRITE_PID=1 | ||
SERVICE_DAEMONIZE=1 | ||
|
||
DAEMON=/usr/sbin/gluon-radv-filterd | ||
|
||
|
||
start() { | ||
service_start $DAEMON | ||
} | ||
|
||
stop() { | ||
service_stop $DAEMON | ||
} |
3 changes: 3 additions & 0 deletions
3
package/gluon-radv-filterd/files/lib/gluon/ebtables/400-radv-filterd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
chain('RADV_FILTER', 'DROP') | ||
rule 'FORWARD -p IPv6 -i bat0 --ip6-protocol ipv6-icmp --ip6-icmp-type router-advertisement -j RADV_FILTER' | ||
rule 'RADV_FILTER -j ACCEPT' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
all: gluon-radv-filterd | ||
|
||
gluon-radv-filterd: gluon-radv-filterd.c | ||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS) |
Oops, something went wrong.