オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /trunk/1.8.x/ccs-patch/security/ccsecurity/network.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3045 by kumaneko, Sat Sep 12 01:53:49 2009 UTC revision 3046 by kumaneko, Wed Sep 16 06:15:44 2009 UTC
# Line 244  static int ccs_network_entry(const bool Line 244  static int ccs_network_entry(const bool
244                               const u32 *address, const u16 port)                               const u32 *address, const u16 port)
245  {  {
246          const int idx = ccs_read_lock();          const int idx = ccs_read_lock();
247          const int error = ccs_network_entry2(is_ipv6, operation,          const int error = ccs_network_entry2(is_ipv6, operation, address,
248                                               address, port);                                               port);
249          ccs_read_unlock(idx);          ccs_read_unlock(idx);
250          return error;          return error;
251  }  }
# Line 394  int ccs_write_network_policy(char *data, Line 394  int ccs_write_network_policy(char *data,
394   *   *
395   * Returns 0 on success, negative value otherwise.   * Returns 0 on success, negative value otherwise.
396   */   */
397  static inline int ccs_network_listen_acl(const bool is_ipv6,  static inline int ccs_network_listen_acl(const bool is_ipv6, const u8 *address,
                                          const u8 *address,  
398                                           const u16 port)                                           const u16 port)
399  {  {
400          return ccs_network_entry(is_ipv6, CCS_NETWORK_TCP_LISTEN,          return ccs_network_entry(is_ipv6, CCS_NETWORK_TCP_LISTEN,
# Line 414  static inline int ccs_network_listen_acl Line 413  static inline int ccs_network_listen_acl
413   */   */
414  static inline int ccs_network_connect_acl(const bool is_ipv6,  static inline int ccs_network_connect_acl(const bool is_ipv6,
415                                            const int sock_type,                                            const int sock_type,
416                                            const u8 *address,                                            const u8 *address, const u16 port)
                                           const u16 port)  
417  {  {
418          u8 operation;          u8 operation;
419          switch (sock_type) {          switch (sock_type) {
# Line 469  static int ccs_network_bind_acl(const bo Line 467  static int ccs_network_bind_acl(const bo
467   *   *
468   * Returns 0 on success, negative value otherwise.   * Returns 0 on success, negative value otherwise.
469   */   */
470  static inline int ccs_network_accept_acl(const bool is_ipv6,  static inline int ccs_network_accept_acl(const bool is_ipv6, const u8 *address,
                                          const u8 *address,  
471                                           const u16 port)                                           const u16 port)
472  {  {
473          int retval;          int retval;
# Line 493  static inline int ccs_network_accept_acl Line 490  static inline int ccs_network_accept_acl
490   */   */
491  static inline int ccs_network_sendmsg_acl(const bool is_ipv6,  static inline int ccs_network_sendmsg_acl(const bool is_ipv6,
492                                            const int sock_type,                                            const int sock_type,
493                                            const u8 *address,                                            const u8 *address, const u16 port)
                                           const u16 port)  
494  {  {
495          u8 operation;          u8 operation;
496          if (sock_type == SOCK_DGRAM)          if (sock_type == SOCK_DGRAM)
# Line 517  static inline int ccs_network_sendmsg_ac Line 513  static inline int ccs_network_sendmsg_ac
513   */   */
514  static inline int ccs_network_recvmsg_acl(const bool is_ipv6,  static inline int ccs_network_recvmsg_acl(const bool is_ipv6,
515                                            const int sock_type,                                            const int sock_type,
516                                            const u8 *address,                                            const u8 *address, const u16 port)
                                           const u16 port)  
517  {  {
518          int retval;          int retval;
519          const u8 operation          const u8 operation
# Line 788  int ccs_socket_sendmsg_permission(struct Line 783  int ccs_socket_sendmsg_permission(struct
783                  else                  else
784                          port = htons(sock->sk->sk_protocol);                          port = htons(sock->sk->sk_protocol);
785                  error = ccs_network_sendmsg_acl(false, type,                  error = ccs_network_sendmsg_acl(false, type,
786                                                  (u8 *) &addr4->sin_addr,                                                  (u8 *) &addr4->sin_addr, port);
                                                 port);  
787                  break;                  break;
788          }          }
789          return error;          return error;

Legend:
Removed from v.3045  
changed lines
  Added in v.3046

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26