Update linuxigd to 1.0, fix compilation

git-svn-id: svn://svn.openwrt.org/openwrt/packages@7446 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2007-06-02 10:21:15 +00:00
parent 409c7c1351
commit 6b6726313f
2 changed files with 75 additions and 2 deletions

View File

@ -10,12 +10,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=linuxigd PKG_NAME:=linuxigd
PKG_VERSION:=0.95 PKG_VERSION:=1.0
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/linux-igd PKG_SOURCE_URL:=@SF/linux-igd
PKG_MD5SUM:=0f203a2db5e3fb01496b73e417dbd9a6 PKG_MD5SUM:=929f5c4878c91d534613b7c7070215d9
PKG_CAT:=zcat PKG_CAT:=zcat
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

View File

@ -0,0 +1,73 @@
diff -urN linuxigd-1.0/iptc.c linuxigd-1.0.new/iptc.c
--- linuxigd-1.0/iptc.c 2006-09-11 17:55:48.000000000 +0200
+++ linuxigd-1.0.new/iptc.c 2007-06-02 12:24:34.000000000 +0200
@@ -22,9 +22,9 @@
struct ipt_entry_match *get_udp_match(const char *sports, const char *dports, unsigned int *nfcache);
struct ipt_entry_target *get_dnat_target(const char *input, unsigned int *nfcache);
-static u_int16_t parse_port(const char *port);
-static void parse_ports(const char *portstring, u_int16_t *ports);
-static int service_to_port(const char *name);
+static u_int16_t igd_parse_port(const char *port);
+void parse_ports(const char *portstring, u_int16_t *ports);
+static int igd_service_to_port(const char *name);
static void parse_range(const char *input, struct ip_nat_range *range);
static struct ipt_natinfo *append_range(struct ipt_natinfo *info, const struct ip_nat_range *range);
@@ -336,13 +336,12 @@
}
/* Copied and modified from libipt_tcp.c and libipt_udp.c */
-
static u_int16_t
-parse_port(const char *port)
+igd_parse_port(const char *port)
{
unsigned int portnum;
- if ((portnum = service_to_port(port)) != -1) {
+ if ((portnum = igd_service_to_port(port)) != -1) {
return (u_int16_t)portnum;
}
else {
@@ -350,7 +349,7 @@
}
}
-static void
+void
parse_ports(const char *portstring, u_int16_t *ports)
{
char *buffer;
@@ -358,19 +357,18 @@
buffer = strdup(portstring);
if ((cp = strchr(buffer, ':')) == NULL)
- ports[0] = ports[1] = parse_port(buffer);
+ ports[0] = ports[1] = igd_parse_port(buffer);
else {
*cp = '\0';
cp++;
- ports[0] = buffer[0] ? parse_port(buffer) : 0;
- ports[1] = cp[0] ? parse_port(cp) : 0xFFFF;
+ ports[0] = buffer[0] ? igd_parse_port(buffer) : 0;
+ ports[1] = cp[0] ? igd_parse_port(cp) : 0xFFFF;
}
free(buffer);
}
-
static int
-service_to_port(const char *name)
+igd_service_to_port(const char *name)
{
struct servent *service;
@@ -382,7 +380,6 @@
-
/* Copied and modified from libipt_DNAT.c */
static void