git://git.onelab.eu
/
transforward.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
54faa59
)
Make kernel version default to the latest one we support in the Makefile
author
Sapan Bhatia
<gwsapan@gmail.com>
Fri, 16 Aug 2013 20:59:32 +0000
(16:59 -0400)
committer
Sapan Bhatia
<gwsapan@gmail.com>
Fri, 16 Aug 2013 20:59:32 +0000
(16:59 -0400)
Makefile
patch
|
blob
|
history
transforward.c
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
2965572
..
78b34dd
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-1,7
+1,15
@@
obj-m += transforward.o
obj-m += transforward.o
+KVER=$(shell uname -r)
+ARCH=$(shell uname -m)
+DIST=fc18 # Is there an easy way of fetching this automatically, short of mapping /etc/redhat-release
+
+ifeq ($(wildcard /lib/modules/$(KVER)/build),)
+ KVER=3.10.6-100.$(DIST).$(KVER)
+endif
+
all:
all:
- make -C /lib/modules/$(
shell uname -r
)/build M=$(PWD) modules
+ make -C /lib/modules/$(
KVER
)/build M=$(PWD) modules
clean:
clean:
- make -C /lib/modules/$(
shell uname -r
)/build M=$(PWD) clean
+ make -C /lib/modules/$(
KVER
)/build M=$(PWD) clean
diff --git
a/transforward.c
b/transforward.c
index
13e6156
..
cd1b512
100644
(file)
--- a/
transforward.c
+++ b/
transforward.c
@@
-41,7
+41,6
@@
MODULE_LICENSE("GPL");
MODULE_VERSION(VERSION_STR);
static int address_in_root(unsigned int haddr) {
MODULE_VERSION(VERSION_STR);
static int address_in_root(unsigned int haddr) {
- //printk(KERN_CRIT "In address_in_root: %u",haddr);
struct net_device *dev;
struct net *net = &init_net;
struct net_device *dev;
struct net *net = &init_net;
@@
-56,6
+55,7
@@
static int address_in_root(unsigned int haddr) {
static int inet_bind_entry(struct socket *sock, struct sockaddr *uaddr, int addr_len) {
struct sockaddr_in *addr = (struct sockaddr_in *)uaddr;
unsigned int snum = addr->sin_addr.s_addr;
static int inet_bind_entry(struct socket *sock, struct sockaddr *uaddr, int addr_len) {
struct sockaddr_in *addr = (struct sockaddr_in *)uaddr;
unsigned int snum = addr->sin_addr.s_addr;
+ //printk(KERN_CRIT "Checking address %d",snum);
if (address_in_root(snum)) {
put_net(sock_net(sock->sk));
sock_net_set(sock->sk, get_net(&init_net));
if (address_in_root(snum)) {
put_net(sock_net(sock->sk));
sock_net_set(sock->sk, get_net(&init_net));