summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c2
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.h2
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe_netlink.c4
-rw-r--r--cmake/cpack.cmake7
-rw-r--r--cmake/debian/debian.cmake44
-rwxr-xr-xcmake/debian/postinst2
-rw-r--r--drivers/ipoe/ipoe.c12
-rw-r--r--drivers/vlan_mon/CMakeLists.txt4
8 files changed, 49 insertions, 28 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index c0adc7f..7f1080d 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -547,7 +547,7 @@ static int ipoe_create_interface(struct ipoe_session *ses)
} else {
pthread_mutex_unlock(&uc_lock);
- ses->ifindex = ipoe_nl_create(ses->serv->ifindex);
+ ses->ifindex = ipoe_nl_create();
if (ses->ifindex == -1) {
log_ppp_error("ipoe: failed to create interface\n");
ap_session_terminate(&ses->ses, TERM_NAS_ERROR, 1);
diff --git a/accel-pppd/ctrl/ipoe/ipoe.h b/accel-pppd/ctrl/ipoe/ipoe.h
index b3912be..94da45d 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.h
+++ b/accel-pppd/ctrl/ipoe/ipoe.h
@@ -146,7 +146,7 @@ void ipoe_serv_recv_arp(struct ipoe_serv *s, struct _arphdr *arph);
void ipoe_nl_add_interface(int ifindex, uint8_t mode);
void ipoe_nl_del_interface(int ifindex);
void ipoe_nl_delete_interfaces(void);
-int ipoe_nl_create(int ifindex);
+int ipoe_nl_create();
void ipoe_nl_delete(int ifindex);
int ipoe_nl_modify(int ifindex, uint32_t peer_addr, uint32_t addr, uint32_t gw, int link_ifindex, uint8_t *hwaddr);
void ipoe_nl_get_sessions(struct list_head *list);
diff --git a/accel-pppd/ctrl/ipoe/ipoe_netlink.c b/accel-pppd/ctrl/ipoe/ipoe_netlink.c
index 4502072..363ff35 100644
--- a/accel-pppd/ctrl/ipoe/ipoe_netlink.c
+++ b/accel-pppd/ctrl/ipoe/ipoe_netlink.c
@@ -236,7 +236,7 @@ void ipoe_nl_delete_interfaces(void)
ipoe_nl_del_interface(-1);
}
-int ipoe_nl_create(int ifindex)
+int ipoe_nl_create()
{
struct rtnl_handle rth;
struct nlmsghdr *nlh;
@@ -263,8 +263,6 @@ int ipoe_nl_create(int ifindex)
ghdr = NLMSG_DATA(&req.n);
ghdr->cmd = IPOE_CMD_CREATE;
- addattr32(nlh, 1024, IPOE_ATTR_IFINDEX, ifindex);
-
if (rtnl_talk(&rth, nlh, 0, 0, nlh, NULL, NULL, 0) < 0 ) {
log_ppp_error("ipoe: nl_create: %s\n", strerror(errno));
goto out;
diff --git a/cmake/cpack.cmake b/cmake/cpack.cmake
index 412eadf..4edf3cf 100644
--- a/cmake/cpack.cmake
+++ b/cmake/cpack.cmake
@@ -2,7 +2,7 @@ INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "11")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_VERSION_PATCH "99")
SET(CPACK_PACKAGE_NAME "accel-ppp")
SET(CPACK_PACKAGE_CONTACT "Dmitry Kozlov <xeb@mail.ru>")
@@ -32,6 +32,11 @@ IF(CPACK_TYPE STREQUAL Debian8)
INCLUDE(${CMAKE_HOME_DIRECTORY}/cmake/debian/debian.cmake)
ENDIF(CPACK_TYPE STREQUAL Debian8)
+IF(CPACK_TYPE STREQUAL Debian9)
+ SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.24), libssl1.0.2 (>= 1.0.2l), libpcre3 (>= 8.39)")
+ INCLUDE(${CMAKE_HOME_DIRECTORY}/cmake/debian/debian.cmake)
+ENDIF(CPACK_TYPE STREQUAL Debian9)
+
IF(CPACK_TYPE STREQUAL Centos7)
SET(CPACK_RPM_PACKAGE_LICENSE "GPL")
SET(CPACK_RPM_PACKAGE_URL "http://accel-ppp.org")
diff --git a/cmake/debian/debian.cmake b/cmake/debian/debian.cmake
index e0e3393..5c994e2 100644
--- a/cmake/debian/debian.cmake
+++ b/cmake/debian/debian.cmake
@@ -1,8 +1,16 @@
SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
SET(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME})
-if (BUILD_DRIVER_ONLY)
- if (BUILD_PPTP_DRIVER)
+if (NOT DEFINED MODULES_KDIR)
+ execute_process(
+ COMMAND uname -r
+ COMMAND tr -d '\n'
+ OUTPUT_VARIABLE MODULES_KDIR
+ )
+endif()
+
+if (BUILD_PPTP_DRIVER)
+ if (BUILD_DRIVER_ONLY)
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "8")
SET(CPACK_PACKAGE_VERSION_PATCH "5")
@@ -11,29 +19,35 @@ if (BUILD_DRIVER_ONLY)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-pptp kernel module")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian-kmod/postinst")
- #INSTALL(DIRECTORY lib/modules/${DEBIAN_KDIR}/extra)
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/driver/driver/pptp.ko DESTINATION lib/modules/${DEBIAN_KDIR}/extra)
- #SET(CPACK_DEBIAN_PACKAGE_DEPENDS "linux-image (= ${LINUX_IMAGE})")
- endif (BUILD_PPTP_DRIVER)
-
- if (BUILD_IPOE_DRIVER)
+ endif ()
+ #INSTALL(DIRECTORY lib/modules/${DEBIAN_KDIR}/extra)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/driver/driver/pptp.ko DESTINATION /lib/modules/${MODULES_KDIR}/extra)
+ #SET(CPACK_DEBIAN_PACKAGE_DEPENDS "linux-image (= ${LINUX_IMAGE})")
+endif (BUILD_PPTP_DRIVER)
+
+if (BUILD_IPOE_DRIVER)
+ if (BUILD_DRIVER_ONLY)
SET(CPACK_PACKAGING_INSTALL_PREFIX "/")
SET(CPACK_PACKAGE_NAME "accel-ppp-ipoe-kmod")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-ppp IPoE kernel module")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian-kmod/postinst")
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/ipoe/driver/ipoe.ko DESTINATION lib/modules/${DEBIAN_KDIR}/extra)
- endif (BUILD_IPOE_DRIVER)
+ endif ()
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/ipoe/driver/ipoe.ko DESTINATION /lib/modules/${MODULES_KDIR}/extra)
+endif (BUILD_IPOE_DRIVER)
- if (BUILD_VLAN_MON_DRIVER)
+if (BUILD_VLAN_MON_DRIVER)
+ if (BUILD_DRIVER_ONLY)
SET(CPACK_PACKAGING_INSTALL_PREFIX "/")
SET(CPACK_PACKAGE_NAME "accel-ppp-vlan_mon-kmod")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "accel-ppp vlan monitoring kernel module")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian-kmod/postinst")
- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/vlan_mon/driver/vlan_mon.ko DESTINATION lib/modules/${DEBIAN_KDIR}/extra)
- endif (BUILD_VLAN_MON_DRIVER)
-else (BUILD_DRIVER_ONLY)
+ endif ()
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/drivers/vlan_mon/driver/vlan_mon.ko DESTINATION /lib/modules/${MODULES_KDIR}/extra)
+endif (BUILD_VLAN_MON_DRIVER)
+
+if (NOT BUILD_DRIVER_ONLY)
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/conffiles")
if (CPACK_TYPE STREQUAL Debian6)
@@ -45,4 +59,4 @@ else (BUILD_DRIVER_ONLY)
INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/contrib/debian/accel-ppp-init DESTINATION /etc/init.d RENAME accel-ppp)
INSTALL(FILES ${CMAKE_HOME_DIRECTORY}/contrib/debian/accel-ppp-default DESTINATION /etc/default RENAME accel-ppp)
endif (CPACK_TYPE STREQUAL Debian6)
-endif (BUILD_DRIVER_ONLY)
+endif ()
diff --git a/cmake/debian/postinst b/cmake/debian/postinst
index cc38181..0c38b0d 100755
--- a/cmake/debian/postinst
+++ b/cmake/debian/postinst
@@ -5,4 +5,6 @@ chmod +x /etc/init.d/accel-ppp
mkdir /var/log/accel-ppp > /dev/null 2>&1
mkdir /var/lib/accel-ppp > /dev/null 2>&1
+depmod
+
exit 0
diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index 71ae1e4..90b04ca 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -709,7 +709,7 @@ static struct ipoe_session *ipoe_lookup_hwaddr(__u8 *hwaddr)
u.hwaddr_u = 0;
memcpy(u.hwaddr, hwaddr, ETH_ALEN);
- head = &ipoe_list3[u.hwaddr_u & IPOE_HASH_BITS];
+ head = &ipoe_list3[hwaddr[ETH_ALEN - 1]];
rcu_read_lock();
@@ -1069,7 +1069,7 @@ static void ipoe_netdev_setup(struct net_device *dev)
#endif
dev->addr_len = ETH_ALEN;
dev->features |= NETIF_F_NETNS_LOCAL;
- dev->features &= ~NETIF_F_HW_VLAN_FILTER;
+ dev->features &= ~(NETIF_F_HW_VLAN_FILTER | NETIF_F_LRO);
dev->header_ops = &ipoe_hard_header_ops;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
}
@@ -1126,7 +1126,7 @@ static int ipoe_create(__be32 peer_addr, __be32 addr, __be32 gw, int ifindex, co
}
if (link_dev) {
- dev->features = link_dev->features & ~NETIF_F_HW_VLAN_FILTER;
+ dev->features = link_dev->features & ~(NETIF_F_HW_VLAN_FILTER | NETIF_F_LRO);
memcpy(dev->dev_addr, link_dev->dev_addr, ETH_ALEN);
memcpy(dev->broadcast, link_dev->broadcast, ETH_ALEN);
}
@@ -1162,7 +1162,7 @@ static int ipoe_create(__be32 peer_addr, __be32 addr, __be32 gw, int ifindex, co
list_add_tail_rcu(&ses->entry, &ipoe_list[h]);
list_add_tail(&ses->entry2, &ipoe_list2);
if (link_dev)
- list_add_tail_rcu(&ses->entry3, &ipoe_list3[ses->u.hwaddr_u & IPOE_HASH_BITS]);
+ list_add_tail_rcu(&ses->entry3, &ipoe_list3[ses->u.hwaddr[ETH_ALEN - 1]]);
r = dev->ifindex;
up(&ipoe_wlock);
@@ -1418,7 +1418,7 @@ static int ipoe_nl_cmd_modify(struct sk_buff *skb, struct genl_info *info)
}
if (link_dev) {
- ses->dev->features = link_dev->features & ~NETIF_F_HW_VLAN_FILTER;
+ ses->dev->features = link_dev->features & ~(NETIF_F_HW_VLAN_FILTER | NETIF_F_LRO);
memcpy(dev->dev_addr, link_dev->dev_addr, ETH_ALEN);
memcpy(dev->broadcast, link_dev->broadcast, ETH_ALEN);
}
@@ -1446,7 +1446,7 @@ static int ipoe_nl_cmd_modify(struct sk_buff *skb, struct genl_info *info)
if (info->attrs[IPOE_ATTR_HWADDR]) {
nla_memcpy(ses->u.hwaddr, info->attrs[IPOE_ATTR_HWADDR], ETH_ALEN);
if (ses->link_dev)
- list_add_tail_rcu(&ses->entry3, &ipoe_list3[ses->u.hwaddr_u & IPOE_HASH_BITS]);
+ list_add_tail_rcu(&ses->entry3, &ipoe_list3[ses->u.hwaddr[ETH_ALEN - 1]]);
}
//pr_info("ipoe: modify %08x %08x\n", ses->peer_addr, ses->addr);
diff --git a/drivers/vlan_mon/CMakeLists.txt b/drivers/vlan_mon/CMakeLists.txt
index 892fed1..1d0c3c8 100644
--- a/drivers/vlan_mon/CMakeLists.txt
+++ b/drivers/vlan_mon/CMakeLists.txt
@@ -14,4 +14,6 @@ ADD_CUSTOM_TARGET(vlan_mon_drv ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/driver/vlan_mon.ko
)
-INSTALL(CODE "EXECUTE_PROCESS(COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/drivers/vlan_mon modules_install)")
+if (NOT DEFINED CPACK_TYPE)
+ INSTALL(CODE "EXECUTE_PROCESS(COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/drivers/vlan_mon modules_install)")
+endif ()