• R/O
  • HTTP
  • SSH
  • HTTPS

dscsd-cap: Commit


Commit MetaInfo

Revision82d11d247340ba65f8dbb2a6f095fec7e0c3aa81 (tree)
Time2018-12-10 08:18:34
AuthorSatoshi Yasuda <7m3tjz;jarl.com>
CommiterSatoshi Yasuda

Log Message

modified: capture_read.c
modified: config.h
modified: configure.in
modified: main.c

Change Summary

Incremental Difference

--- a/capture_read.c
+++ b/capture_read.c
@@ -25,10 +25,10 @@ void capture_read (void)
2525 }
2626 data_p = (pkt_data[14] & 0x0f) * 4 + 22;
2727
28- k = (pkt_data[14] & 0x0f) * 4 + 18; /* ip_header_length + ether_header_length + 4 */
28+ k = (pkt_data[14] & 0x0f) * 4 + 18;
29+ /* ip_header_length + ether_header_length + 4 */
2930 length = pkt_data[k] * 256 + pkt_data[k+1] - 8; /* UDP data length */
3031
31- //if ((length == 32) || ((length == 16) && (pkt_data[data_p+4] != 0x02)))
3232 if ((length == 32) || (length == 16))
3333 {
3434
@@ -45,7 +45,8 @@ void capture_read (void)
4545 memcpy (&buff[4], &pkt_data[34], 2);
4646 for (rp = result ; rp != NULL ; rp = rp->ai_next)
4747 {
48- sendto (sock, buff, length+8, 0, rp->ai_addr, rp->ai_addrlen);
48+ if (OwnDscsdIP.s_addr != ((struct sockaddr_in *)(rp->ai_addr))->sin_addr.s_addr)
49+ sendto (sock, buff, length+8, 0, rp->ai_addr, rp->ai_addrlen);
4950 }
5051 }
5152 if (result) freeaddrinfo (result);
--- a/config.h
+++ b/config.h
@@ -81,7 +81,7 @@
8181 #define PACKAGE_NAME "dscsd_capd"
8282
8383 /* Define to the full name and version of this package. */
84-#define PACKAGE_STRING "dscsd_capd 00.05"
84+#define PACKAGE_STRING "dscsd_capd 00.06"
8585
8686 /* Define to the one symbol short name of this package. */
8787 #define PACKAGE_TARNAME "dscsd_capd"
@@ -90,7 +90,7 @@
9090 #define PACKAGE_URL ""
9191
9292 /* Define to the version of this package. */
93-#define PACKAGE_VERSION "00.05"
93+#define PACKAGE_VERSION "00.06"
9494
9595 /* Define to 1 if you have the ANSI C header files. */
9696 #define STDC_HEADERS 1
@@ -99,7 +99,7 @@
9999 #define TIME_WITH_SYS_TIME 1
100100
101101 /* Version number of package */
102-#define VERSION "00.05"
102+#define VERSION "00.06"
103103
104104 /* Define to rpl_malloc if the replacement function should be used. */
105105 /* #undef malloc */
--- a/configure.in
+++ b/configure.in
@@ -2,7 +2,7 @@
22 # Process this file with autoconf to produce a configure script.
33
44 AC_PREREQ([2.59])
5-AC_INIT(dscsd_capd, 00.05, 7m3tjz@jarl.com)
5+AC_INIT(dscsd_capd, 00.06, 7m3tjz@jarl.com)
66 AC_CONFIG_SRCDIR([main.c])
77 AC_CONFIG_HEADERS([config.h])
88
--- a/main.c
+++ b/main.c
@@ -14,7 +14,6 @@ main(int argc, const char **argv)
1414 {
1515 int ret;
1616 time_t curtime;
17- time_t reload_time;
1817
1918 OwnDscsdIP.s_addr = 0;
2019
@@ -66,7 +65,6 @@ main(int argc, const char **argv)
6665
6766 get_server_ip();
6867 time (&curtime);
69- reload_time = curtime;
7068
7169 while (1) /* ループ */
7270 {
@@ -80,11 +78,6 @@ main(int argc, const char **argv)
8078 if (FD_ISSET (pcap_fd, &read_set)) capture_read();
8179 if (FD_ISSET (sock, &read_set)) send_dscsd();
8280 }
83-// if ((atime - reload_time) >= 300)
84-// {
85-// get_server_ip();
86-// reload_time = atime;
87-// }
8881 if (sig_term)
8982 {
9083 syslog (LOG_INFO, "dscsd Capture & Re-Send End\n");
Show on old repository browser