summaryrefslogtreecommitdiff
path: root/ipanat
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-09-13 17:25:59 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2014-09-13 17:25:59 -0700
commite36f3320a8cd36eb76d611989c67ae7184868da1 (patch)
tree8488643bf00d4cdeb7e1df0614fc1270b23ec4a6 /ipanat
parent3d5511dfac160799a7d884e5461608eff9ece268 (diff)
parent49e65abef920eb377b79d5db4535084c950e0cf4 (diff)
downloadipacfg-mgr-e36f3320a8cd36eb76d611989c67ae7184868da1.tar.gz
Merge "ipanat: move ipaNatTable device node creation"
Diffstat (limited to 'ipanat')
-rw-r--r--ipanat/src/ipa_nat_drvi.c40
1 files changed, 1 insertions, 39 deletions
diff --git a/ipanat/src/ipa_nat_drvi.c b/ipanat/src/ipa_nat_drvi.c
index 75b38a8..74161a7 100644
--- a/ipanat/src/ipa_nat_drvi.c
+++ b/ipanat/src/ipa_nat_drvi.c
@@ -165,24 +165,7 @@ uint32_t Read32BitFieldValue(uint32_t param,
*/
int CreateNatDevice(struct ipa_ioc_nat_alloc_mem *mem)
{
-#define EVENT_SIZE (sizeof (struct inotify_event))
-#define FILE_NAME_LENGTH (sizeof(NAT_DEV_NAME)*2 + 1)
-#define BUF_LEN (EVENT_SIZE + FILE_NAME_LENGTH)
-
- int length;
- int wd;
- char buffer[BUF_LEN];
- int ret, inotify_fd;
-
- inotify_fd = inotify_init();
- if (inotify_fd < 0) {
- perror("inotify_init");
- return -EINVAL;
- }
-
- IPADBG("Waiting for nofications in dir %s\n", NAT_DEV_DIR);
- wd = inotify_add_watch(inotify_fd,
- NAT_DEV_DIR, IN_CREATE);
+ int ret;
ret = ioctl(ipv4_nat_cache.ipa_fd, IPA_IOC_ALLOC_NAT_MEM, mem);
if (ret != 0) {
@@ -192,27 +175,6 @@ int CreateNatDevice(struct ipa_ioc_nat_alloc_mem *mem)
return -EINVAL;
}
IPADBG("posted IPA_IOC_ALLOC_NAT_MEM to kernel successfully\n");
-
- length = read(inotify_fd, buffer, BUF_LEN);
-
- if (length < 0) {
- perror("inotify read");
- return -EINVAL;
- }
-
- struct inotify_event *event = (struct inotify_event *)buffer;
- if (event->len) {
- if (event->mask & IN_CREATE) {
- if (event->mask & IN_ISDIR) {
- IPADBG("The directory %s was created.\n", event->name);
- } else {
- IPADBG("The file %s was created.\n", event->name);
- }
- }
- }
-
- (void) inotify_rm_watch(inotify_fd, wd);
- (void) close(inotify_fd);
return 0;
}